package com.crm.jpaandthymeleaf.repository;

import com.crm.jpaandthymeleaf.entity.SysUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * @author 周敬
 * @version 1.0
 * @packageName com.crm.jpaandthymeleaf.repository
 * @fileName SysUserRepository
 * @createTime 2021/12/15-20:41-星期三
 * @lastModify 2021/12/15-20:41-星期三
 */
public interface SysUserRepository extends JpaRepository<SysUser,Long>, JpaSpecificationExecutor<SysUser> {
    /**
     * 根据用户名和密码查询用户
     * @param usrName 用户名
     * @param usrPassword 密码
     * @return
     */
    List<SysUser> findByUsrNameAndUsrPassword(String usrName,String usrPassword);

    /**
     * 根据用户名查询用户对象
     * @param usrName
     * @return
     */
    SysUser findSysUserByUsrName(String usrName);
}
